package com.movie.controller;

import com.movie.dto.MovieDTO;
import com.movie.utils.Result;
import com.movie.entity.Movie;
import com.movie.service.RecommendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/movie")
public class RecommendController {

    @Autowired
    private RecommendService recommendService;

    // 推荐接口
    @GetMapping("/recommend/{userId}")
    public Result<List<MovieDTO>> recommend(@PathVariable Integer userId) {
        List<MovieDTO> movies = recommendService.recommendMoviesForUser(userId);
        return Result.success(movies);
    }
}
